package com.choudou5.solr.web.handler;

import com.choudou5.solr.web.handler.*;
import com.choudou5.solr.web.handler.sys.*;

import java.util.HashMap;
import java.util.Map;

/**
 * @name：处理助手
 * @author：choudou5
 * @date：2018/7/25
 */
public class SysHandlerHelper {

    private final static Map<String, BaseHandler> handlerMap = new HashMap<>();

    static {
        handlerMap.put("login", new LoginHandler());
        handlerMap.put("user", new UserHandler());
        handlerMap.put("sysDynamic", new SysDynamicHandler());
        handlerMap.put("dicExtWords", new DicExtWordsHandler());
        handlerMap.put("page", new PageHandler());
        handlerMap.put("searchOptimize", new SearchOptimizeHandler());
        handlerMap.put("searchHi", new SearchHiHandler());
        handlerMap.put("system", new SystemHandler());
        handlerMap.put("superAdmin", new SuperAdminHandler());
        handlerMap.put("sysEx", new SysExceptionHandler());
        handlerMap.put("index", new IndexHandler());
    }

    /**
     * 获取 handler
     * @param name
     * @return
     */
    public static BaseHandler getHandler(String name){
        return handlerMap.get(name);
    }
}
